﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Orchard.Forms.Services;
using Orchard.DisplayManagement;
using Orchard.Localization;

namespace Piedone.Facebook.Suite.Rules.Rules
{
    public class PostToFacebookPageForm : IFormProvider
    {
        private dynamic _shapeFactory;

        public Localizer T { get; set; }

        public PostToFacebookPageForm(IShapeFactory shapeFactory)
        {
            _shapeFactory = shapeFactory;

            T = NullLocalizer.Instance;
        }

        public void Describe(DescribeContext context)
        {
            context.Form("ActionPostToFacebookPage",
                shape => _shapeFactory.Form(
                    Id: "ActionPostToFacebookPage",
                    _Type: _shapeFactory.Textbox(
                        Id: "ContentId", Name: "ContentId",
                        Title: T("Content Item Id"),
                        Description: T("Content Item Id."),
                        Classes: new[] { "tokenized" })
                )
            );
        }
    }
}
